package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.MedicalHistory;
import com.itheima.pojo.Member;
import com.itheima.pojo.MemberMsg;
import com.itheima.pojo.Order;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chencfgs
 * @date 2019-12-06 20:00
 */
public interface MemberDao {

    Member findByTelephone(String telephone);

    void add(Member member);

    Member findById(Integer memberId);

    Integer findMemberCountBeforeDate(String date);

    Integer findMemberCountByDate(String today);

    Integer findMemberCountAfterDate(String thisWeekMonday);

    Integer findOrderCountByDate(String today);

    Integer findOrderCountAfterDate(String thisWeekMonday);

    void update(Member member);

    /**
     * 会员分页查询
     * @param queryString
     * @return
     */
    Page<Member> findPage(@Param("queryString") String queryString);

    /**
     * 添加会员动态信息
     * @param memberMsg
     */
    void addMemberMsg(MemberMsg memberMsg);

    /**
     * 添加病史信息
     * @param medicalHistory
     */
    void addMedicalHistory(MedicalHistory medicalHistory);

    /**
     * 添加会员信息
     * @param member
     */
    void addMember(Member member);

    /**
     * 通过memberId获取关联表id
     * @param memberId
     */
    Member findOneById(Integer memberId);

    /**
     * 删除关联的会员动态信息表
     * @param msg_id
     */
    void deleteMember_msgById(Integer msg_id);

    /**
     * 删除关联的病史表
     * @param mhistory_id
     */
    void deleteMedical_historyById(Integer mhistory_id);

    /**
     * 删除会员档案主表
     * @param memberId
     */
    void deleteMember(Integer memberId);

    /**
     * 通过member主表id查询从表msg
     * @param msgId
     * @return
     */
    MemberMsg findMember_msgById(Integer msgId);

    /**
     * 通过member主表id查询从表medical
     * @param mhistoryId
     * @return
     */
    MedicalHistory findMedical_historyById(Integer mhistoryId);

    /**
     * 更新msg
     * @param memberMsg
     */
    void updateMemberMsg(MemberMsg memberMsg);

    /**
     * 更新病史
     * @param medicalHistory
     */
    void updateMedicalHistory(MedicalHistory medicalHistory);

    /**
     * 更新会员档案
     * @param member
     */
    void updateMember(Member member);

    /**
     * 查询管理师
     * @param username
     * @return
     */
    List<String> findUsername(String username);
    /*Integer findOrderCountByDate(String today);

    Integer findOrderCountAfterDate(String thisWeekMonday);*/
}
